﻿using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Art_To_Eagle.Lib.EagleLib.Structure
{
    public class WebImage
    {
        public string Url;
        public string Name;
        public string Website;
        public string Annotation;
        public string[] Tags;
        public long ModificationTime;

        public WebImage() {
            ModificationTime = GetTimeStamp();
        }

        public WebImage(string url, string name, string website = null, string annotation = null,
            string[] tags = null, long modificationTime = -1)
        {
            Url = url;
            Name = name;
            Website = website;
            Annotation = annotation;
            Tags = tags;
            ModificationTime = (modificationTime == -1) ? GetTimeStamp() : modificationTime;
        }

        public long GetTimeStamp()
            => new DateTimeOffset(DateTime.UtcNow).ToUnixTimeMilliseconds();
    }
}
